package com.example.demo.friendship.model.mongodb;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;

@Document(collection = "pagePostCollected")
public class PagePostCollected implements Serializable {

    private static final long serialVersionUID = 3383418822582927253L;

    @Id
    @JsonIgnore
    private String id;
    /**The page's facebook id*/
    @Indexed
    private Long fbPageId;
    /**post unique id*/
    @Indexed
    private Long postId;
    /**
     * Post type
     * */
    private Integer postType;
    /**
     * Post url of facebook
     * */
    private String postUrl;
    /**
     * Domain
     * */
    private String domain;
    /**
     * Web url of the post
     * */
    private String webUrl;
    /**
     * web title of the post
     * */
    private String webPostTitle;
    /**
     * post time
     * */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date postTime;
    /**
     * like count
     * */
    private Integer likeCount;
    /**
     * share count
     * */
    private Integer shareCount;
    /**
     * comment count
     * */
    private Integer commentCount;

    @JsonIgnore
    private Date timeStamp = new Date();

    @JsonIgnore
    private Date expireTime;

    public Date getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Long getFbPageId() {
        return fbPageId;
    }

    public void setFbPageId(Long fbPageId) {
        this.fbPageId = fbPageId;
    }

    public Long getPostId() {
        return postId;
    }

    public void setPostId(Long postId) {
        this.postId = postId;
    }

    public Integer getPostType() {
        return postType;
    }

    public void setPostType(Integer postType) {
        this.postType = postType;
    }

    public String getPostUrl() {
        return postUrl;
    }

    public void setPostUrl(String postUrl) {
        this.postUrl = postUrl;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getWebUrl() {
        return webUrl;
    }

    public void setWebUrl(String webUrl) {
        this.webUrl = webUrl;
    }

    public String getWebPostTitle() {
        return webPostTitle;
    }

    public void setWebPostTitle(String webPostTitle) {
        this.webPostTitle = webPostTitle;
    }

    public Date getPostTime() {
        return postTime;
    }

    public void setPostTime(Date postTime) {
        this.postTime = postTime;
    }

    public Integer getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }

    public Integer getShareCount() {
        return shareCount;
    }

    public void setShareCount(Integer shareCount) {
        this.shareCount = shareCount;
    }

    public Integer getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    public Date getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Date timeStamp) {
        this.timeStamp = timeStamp;
    }
}
